namespace DotNetNuke.Security.Roles
{
    using System;
    using System.Xml.Serialization;

    /// -----------------------------------------------------------------------------
    /// Project:    DotNetNuke
    /// Namespace:  DotNetNuke.Security.Roles
    /// Class:      RoleInfo
    /// -----------------------------------------------------------------------------
    /// <summary>
    /// The RoleInfo class provides the Entity Layer Role object
    /// </summary>
    /// <history>
    /// [cnurse]    05/23/2005  made compatible with .NET 2.0
    /// </history>
    /// -----------------------------------------------------------------------------
    [XmlRoot("role", IsNullable=false)]
    public class RoleInfo
    {
        private bool _AutoAssignment;
        private string _BillingFrequency;
        private int _BillingPeriod;
        private string _Description;
        private bool _IsPublic;
        private int _PortalID;
        private int _RoleID;
        private string _RoleName;
        private float _ServiceFee;
        private float _TrialFee;
        private string _TrialFrequency;
        private int _TrialPeriod;

        /// <summary>
        /// Gets and sets whether users are automatically assigned to the role
        /// </summary>
        /// <value>A boolean (True/False)</value>
        [XmlElement("autoassignment")]
        public bool AutoAssignment
        {
            get
            {
                return this._AutoAssignment;
            }
            set
            {
                this._AutoAssignment = value;
            }
        }

        /// <summary>
        /// Gets and sets the Billing Frequency for the role
        /// </summary>
        /// <value>A String representing the Billing Frequency of the Role<br />
        /// <ul>
        /// <list>N - None</list>
        /// <list>O - One time fee</list>
        /// <list>D - Daily</list>
        /// <list>W - Weekly</list>
        /// <list>M - Monthly</list>
        /// <list>Y - Yearly</list>
        /// </ul>
        /// </value>
        [XmlElement("billingfrequency")]
        public string BillingFrequency
        {
            get
            {
                return this._BillingFrequency;
            }
            set
            {
                this._BillingFrequency = value;
            }
        }

        /// <summary>
        /// Gets and sets the length of the billing period
        /// </summary>
        /// <value>An integer representing the length of the billing period</value>
        [XmlElement("billingperiod")]
        public int BillingPeriod
        {
            get
            {
                return this._BillingPeriod;
            }
            set
            {
                this._BillingPeriod = value;
            }
        }

        /// <summary>
        /// Gets an sets the Description of the Role
        /// </summary>
        /// <value>A string representing the description of the role</value>
        [XmlElement("description")]
        public string Description
        {
            get
            {
                return this._Description;
            }
            set
            {
                this._Description = value;
            }
        }

        /// <summary>
        /// Gets and sets whether the role is public
        /// </summary>
        /// <value>A boolean (True/False)</value>
        [XmlElement("ispublic")]
        public bool IsPublic
        {
            get
            {
                return this._IsPublic;
            }
            set
            {
                this._IsPublic = value;
            }
        }

        /// <summary>
        /// Gets and sets the Portal Id for the Role
        /// </summary>
        /// <value>An Integer representing the Id of the Portal</value>
        [XmlIgnore]
        public int PortalID
        {
            get
            {
                return this._PortalID;
            }
            set
            {
                this._PortalID = value;
            }
        }

        /// <summary>
        /// Gets and sets the Role Id
        /// </summary>
        /// <value>An Integer representing the Id of the Role</value>
        [XmlIgnore]
        public int RoleID
        {
            get
            {
                return this._RoleID;
            }
            set
            {
                this._RoleID = value;
            }
        }

        /// <summary>
        /// Gets and sets the Role Name
        /// </summary>
        /// <value>A string representing the name of the role</value>
        [XmlElement("rolename")]
        public string RoleName
        {
            get
            {
                return this._RoleName;
            }
            set
            {
                this._RoleName = value;
            }
        }

        /// <summary>
        /// Gets and sets the fee for the role
        /// </summary>
        /// <value>A single number representing the fee for the role</value>
        [XmlElement("servicefee")]
        public float ServiceFee
        {
            get
            {
                return this._ServiceFee;
            }
            set
            {
                this._ServiceFee = value;
            }
        }

        /// <summary>
        /// Gets and sets the trial fee for the role
        /// </summary>
        /// <value>A single number representing the trial fee for the role</value>
        [XmlElement("trialfee")]
        public float TrialFee
        {
            get
            {
                return this._TrialFee;
            }
            set
            {
                this._TrialFee = value;
            }
        }

        /// <summary>
        /// Gets and sets the Trial Frequency for the role
        /// </summary>
        /// <value>A String representing the Trial Frequency of the Role<br />
        /// <ul>
        /// <list>N - None</list>
        /// <list>O - One time fee</list>
        /// <list>D - Daily</list>
        /// <list>W - Weekly</list>
        /// <list>M - Monthly</list>
        /// <list>Y - Yearly</list>
        /// </ul>
        /// </value>
        [XmlElement("trialfrequency")]
        public string TrialFrequency
        {
            get
            {
                return this._TrialFrequency;
            }
            set
            {
                this._TrialFrequency = value;
            }
        }

        /// <summary>
        /// Gets and sets the length of the trial period
        /// </summary>
        /// <value>An integer representing the length of the trial period</value>
        [XmlElement("trialperiod")]
        public int TrialPeriod
        {
            get
            {
                return this._TrialPeriod;
            }
            set
            {
                this._TrialPeriod = value;
            }
        }
    }
}

